package org.teziyou.ticket.enumtype;

public enum CommentStarEnum {
	
	XING5(2034, 70, "很好"),
	XING4(2035, 56, "好"),
	XING3(2036, 42, "一般"),
	XING2(2037, 28, "差"),
	XING1(2038, 14, "很差");
	
	private int code;
	private int len;
	private String desc;
	
	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public int getLen() {
		return len;
	}

	public void setLen(int len) {
		this.len = len;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	private CommentStarEnum(int code, int len, String desc) {
		this.code = code;
		this.len = len;
		this.desc = desc;
	}

	public static CommentStarEnum getEnumByCode(int code) {
		CommentStarEnum[] enums = CommentStarEnum.values();
		for(CommentStarEnum enumtype:enums) {
			if(code==enumtype.getCode())
				return enumtype;
		}
		return null;
	} 

}
